#ifndef _UTILS_H_H
#define _UTILS_H_H

#include <stdio.h>
#include <SDL/SDL.h>
#include <SDL/SDL_draw.h>
#include <SDL/SDL_mixer.h>
#include "anselmu.h"

#define RAD_TO_DEG_VAL 57.2957795131
#define DEG_TO_RAD_VAL 0.01745329251

#define DEG_TO_RAD(x) (x*DEG_TO_RAD_VAL)
#define RAD_TO_DEG(x) (x*RAD_TO_DEG_VAL)

#define BLACK  0x000000
#define WHITE  0xFFFFFF
#define RED    0xFF0000
#define GREEN  0x00FF00
#define BLUE   0x0000FF
#define HOTPINK 0xFF69B4

#define randNum(LO, HI) (LO + (float)rand()/((float)RAND_MAX/(HI-LO)))

#define clearScreen() SDL_FillRect(screen, 0, BLACK)

#define SCREEN_W 1080
#define SCREEN_H 720

extern int anselmu_running;
extern SDL_Surface *screen;

/* Fonts and sounds */
extern TTF_Font *oneDirection;
extern Mix_Chunk *ball_hit_snd, *ball_respawn_snd;



void initSDL();
void closeSDL();
void anselmuEvents();
void loadFonts();
void cleanFonts();
void loadSounds();
void cleanSounds();

void credits();


#define drawLine(x1, y1, x2, y2, color) Draw_Line(screen, x1, y1, x2, y2, color)
void drawRect(int x, int y, int w, int h, unsigned int color);

/* Credits */
extern char *credits_array[];

#endif
